package com.example.zlpermissionservice.framework.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import javax.sql.DataSource;

/**
 * @Author zhenliu（孙凌岳）
 * @Description TODO
 * @Date 2025/6/14 19:51
 * @Version 1.0
 */
@Configuration
@EnableTransactionManagement // 启用事务管理
public class MyBatisConfig {

    @Bean
    public PlatformTransactionManager transactionManager(DataSource dataSource) {
        return new DataSourceTransactionManager(dataSource);
    }
}